home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
link.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-15
|
483b
|
36 lines
/* make a hard link */
#include <errno.h>
#include <mintbind.h>
#include <param.h>
#include <unistd.h>
#include "lib.h"
extern int __mint;
/*
* if MiNT is not active, we try to fail gracefully
*/
int
link(_old, _new)
const char *_old, *_new;
{
long r;
char old[MAXPATHLEN], new[MAXPATHLEN];
if (__mint < 9) {
errno = EXDEV;
return -1;
}
_unx2dos(_old, old);
_unx2dos(_new, new);
r = Flink(old, new);
if (r < 0) {
errno = (int) -r;
return -1;
}
return 0;
}